/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.java.Mail;

import java.util.Calendar;
import java.util.TimerTask;

/**
 *
 * @author Zecons
 */
public class Timer {
    
    ReadTime rt = new ReadTime();
    
    public void StartTimer()
    {
        java.util.Timer timer = new java.util.Timer();
		TimerTask tt = new TimerTask(){
			public void run(){
				Calendar cal = Calendar.getInstance(); //this is the method you should use, not the Date(), because it is desperated.
 
				int hour = cal.get(Calendar.HOUR_OF_DAY);//get the hour number of the day, from 0 to 23
 
				if(hour == 17){
					//System.out.println("doing the scheduled task");
				}
                                System.out.print("s");
                                rt.TimeRead();
			}
		};
		timer.schedule(tt, 1000, 1000*5);//	delay the task 1 second, and then run task every five seconds
    }
}
